﻿#ifndef WRWORKMAINACTIONENTRY
#define WRWORKMAINACTIONENTRY

#include <QIcon>
#include <QString>
#include <QDomElement>
#include "../../WRSoft-Utility/Runtime/WRClass.h"

//表示工作主功能项目。
class WRWorkMainActionEntry
{
public:
    //枚举菜单类型。
    enum Kind
    {
        //内部命令
        Command,
        //界面部件
        GuiPart,
    };

private:
    //类型。
    Kind m_kind;
    //图形。
    QIcon m_icon;
    //名称
    QString m_name;
    //名称。
    QString m_title;
    //描述。
    QString m_description;
    //激活器。
    WRClassActivator* m_activator;
    //初始参数。
    QDomElement m_initParams;

public:
    //初始化工作主菜单项目。
    inline WRWorkMainActionEntry(void)
        : m_activator(0)
    {
        //add code here
    }
    //初始化工作主菜单项目。
    inline WRWorkMainActionEntry(Kind kind, const QIcon& icon, const QString& name, const QString& title, const QString& description, WRClassActivator* activator, const QDomElement& initParams)
        : m_kind(kind), m_icon(icon), m_name(name), m_title(title), m_description(description), m_activator(activator), m_initParams(initParams)
    {
        //add code here
    }

    //复制构造函数。
    inline WRWorkMainActionEntry(const WRWorkMainActionEntry& other)
        : m_kind(other.m_kind), m_icon(other.m_icon), m_name(other.m_name), m_title(other.m_title), m_description(other.m_description), m_activator(other.m_activator), m_initParams(other.m_initParams)
    {
        //add code here
    }
    //赋值操作符。
    inline WRWorkMainActionEntry& operator=(const WRWorkMainActionEntry& other)
    {
        if (&other != this)
        {
            m_kind = other.m_kind;
            m_icon = other.m_icon;
            m_name = other.m_name;
            m_title = other.m_title;
            m_description = other.m_description;
            m_activator = other.m_activator;
            m_initParams = other.m_initParams;
        }
        return *this;
    }

    //获取菜单类型。
    inline Kind kind(void) const
    {
        return m_kind;
    }

    //获取图标。
    inline const QIcon& icon(void) const
    {
        return m_icon;
    }
    //获取名称。
    inline const QString& name(void) const
    {
        return m_name;
    }
    //获取标题。
    inline const QString& title(void) const
    {
        return m_title;
    }
    //获取描述。
    inline const QString& description(void) const
    {
        return m_description;
    }

    //获取激活器。
    inline WRClassActivator* activator(void) const
    {
        return m_activator;
    }
    //获取初始参数。
    inline const QDomElement& initParams(void) const
    {
        return m_initParams;
    }
};

#endif // WRWORKMAINACTIONENTRY

